
/*
 * Copyright 2002-2019 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/*
 *版权所有2002-2019原作者。
 *
 *根据Apache许可证2.0版（“许可证”）获得许可；
 *除非符合许可证，否则不得使用此文件。
 *您可以在以下地址获取许可证副本：
 *
 *      https://www.apache.org/licenses/LICENSE-2.0
 *
 *除非适用法律要求或书面同意，软件
 *根据许可证分发的内容是按“原样”分发的，
 *无任何明示或暗示的保证或条件。
 *有关管理权限和
 *许可证下的限制。
 */

package org.springframework.beans.factory.config;

import org.springframework.beans.BeansException;

/**
 * Factory hook that allows for custom modification of an application context's
 * bean definitions, adapting the bean property values of the context's underlying
 * bean factory.
 *
 * <p>Useful for custom config files targeted at system administrators that
 * override bean properties configured in the application context. See
 * {@link PropertyResourceConfigurer} and its concrete implementations for
 * out-of-the-box solutions that address such configuration needs.
 *
 * <p>A {@code BeanFactoryPostProcessor} may interact with and modify bean
 * definitions, but never bean instances. Doing so may cause premature bean
 * instantiation, violating the container and causing unintended side effects.
 * If bean instance interaction is required, consider implementing
 * {@link BeanPostProcessor} instead.
 *
 * <h3>Registration</h3>
 * <p>An {@code ApplicationContext} auto-detects {@code BeanFactoryPostProcessor}
 * beans in its bean definitions and applies them before any other beans get created.
 * A {@code BeanFactoryPostProcessor} may also be registered programmatically
 * with a {@code ConfigurableApplicationContext}.
 *
 * <h3>Ordering</h3>
 * <p>{@code BeanFactoryPostProcessor} beans that are autodetected in an
 * {@code ApplicationContext} will be ordered according to
 * {@link org.springframework.core.PriorityOrdered} and
 * {@link org.springframework.core.Ordered} semantics. In contrast,
 * {@code BeanFactoryPostProcessor} beans that are registered programmatically
 * with a {@code ConfigurableApplicationContext} will be applied in the order of
 * registration; any ordering semantics expressed through implementing the
 * {@code PriorityOrdered} or {@code Ordered} interface will be ignored for
 * programmatically registered post-processors. Furthermore, the
 * {@link org.springframework.core.annotation.Order @Order} annotation is not
 * taken into account for {@code BeanFactoryPostProcessor} beans.
 *
 * @author Juergen Hoeller
 * @author Sam Brannen
 * @since 06.07.2003
 * @see BeanPostProcessor
 * @see PropertyResourceConfigurer
 */
/**
 *允许自定义修改应用程序上下文的工厂钩子
 *bean定义，调整上下文底层的bean属性值
 *豆工厂。
 *
 *＜p＞适用于针对系统管理员的自定义配置文件
 *覆盖应用程序上下文中配置的bean财产。看见
 *｛@link PropertyResourceConfigurer｝及其具体实现
 *解决此类配置需求的开箱即用解决方案。
 *
 *＜p＞｛@code BeanFactoryPostProcessor｝可以与bean交互并修改bean
 *定义，但绝不是bean实例。这样做可能会导致早产
 *实例化，违反容器并导致意外的副作用。
 *如果需要bean实例交互，请考虑实现
 *｛@link BeanPostProcessor｝。
 *
 *<h3>注册</h3>
 *＜p＞｛@code ApplicationContext｝自动检测｛@codeBeanFactoryPostProcessor｝
 *并在创建任何其他bean之前应用它们。
 *｛@code BeanFactoryPostProcessor｝也可以通过编程方式注册
 *使用｛@code ConfigurationApplicationContext｝。
 *
 *<h3>订购</h3>
 *＜p＞｛@code BeanFactoryPostProcessor｝在
 *｛@code ApplicationContext｝将根据
 *｛@link org.springframework.core.PriorityOrdered｝和
 *{@link.org.springframework.core.Ordered}语义。相反
 *｛@code BeanFactoryPostProcessor｝以编程方式注册的bean
 *使用｛@code ConfigurationApplicationContext｝将按以下顺序应用
 *注册；通过实现
 *｛@code PriorityOrdered｝或｛@ccode Ordered｝｝接口将被忽略
 *以编程方式注册的后处理器。此外
 *｛@link org.springframework.core.annotation.Order@Order｝注释不是
 *考虑到｛@code BeanFactoryPostProcessor｝bean。
 *
 *@作者Juergen Hoeller
 *@作者Sam Brannen
 *@自2003年7月6日
 *@参见BeanPostProcessor
 *@参见PropertyResourceConfigurer
 */
@FunctionalInterface
public interface BeanFactoryPostProcessor {

	/**
	 * Modify the application context's internal bean factory after its standard
	 * initialization. All bean definitions will have been loaded, but no beans
	 * will have been instantiated yet. This allows for overriding or adding
	 * properties even to eager-initializing beans.
	 * @param beanFactory the bean factory used by the application context
	 * @throws org.springframework.beans.BeansException in case of errors
	 */
	/**
	 *在标准之后修改应用程序上下文的内部bean工厂
	 *初始化。将加载所有bean定义，但没有bean
	 *将被实例化。这允许覆盖或添加
	 *甚至急于初始化bean的财产。
	 *@param beanFactory应用程序上下文使用的bean工厂
	 *出现错误时@throws org.springframework.beans.BeansException
	 */
	void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException;

}
